app.directive('featuresList', ['dataRequest', function(dataRequest) {
  var features;

  return {
    restrict: 'EA',
    templateUrl: '/js/directives/features-list.html',
    link: function(scope) {
      if (features) {
        scope.features = features;
      }
      else {
        dataRequest.read('Feature')
        .then(function(data){
          features = data.results;
          scope.features = features;
        }, function(err, status){
          console.log(err);
        });
      }
    }
  };
}]);